import { apiHttp } from '/@/utils/axios';
import type { commonResponse } from './common'
import { PropType } from 'vue';

interface singleIndexList{
  id ?:string;
  name?:string;
  val?:string;
}

export interface singleBaseModel {
  constrUnitName?:string ;
  planAssets?:string ;
  projectAddr?:string ;
  projectId?:string ;
  projectModule?:string ;
  projectName?:string ;
  projectTypeName?:string ;
  singleCode?:string ;
  singleName?:string ;
  status?:string ;
  singleIndexList:singleIndexList[]
}

export const detailProps = {
  detail: {
    type: Object as PropType<singleBaseModel>,
    default: {}
  }
}


export const getSingleBaseApi = (singleId:string) => {
  return apiHttp.post<singleBaseModel>({ url: '/single/baseInfo', params: { singleId } });
}

export const getSingleReviewApi = params => {
  return apiHttp.post<commonResponse>({ url: '/single/review', params }, { isTransformRequestResult: false });
}

export const getSinglePermitApi = params => {
  return apiHttp.post<commonResponse>({ url: '/single/permit', params }, { isTransformRequestResult: false });
}

export const getSinglePermitCorpApi = params => {
  return apiHttp.post<commonResponse>({ url: '/single/permitCorp', params }, { isTransformRequestResult: false });
}

export const getSingleQualityApi = params => {
  return apiHttp.post<commonResponse>({ url: '/single/quality', params }, { isTransformRequestResult: false });
}

export const getSingleFinishApi = params => {
  return apiHttp.post<commonResponse>({ url: '/single/finish', params }, { isTransformRequestResult: false });
}

